<?php

/**
 * ProveedorController
 * 
 * @package Sgit 
 * @author Juan Manuel Martinez Carrillo
 * @copyright Juan Manuel Martinez Carrillo
 * @version 2012
 * @access public
 * @revision 17/02/2012 9:06:
 * 
 */



class ProveedorController extends Sgit_Controller_Action
{
    
    protected $_main_model = 'Proveedor';
    protected $_main_form = 'Proveedor';
    protected $_checkZona=TRUE;
    

    
    public function indexAction()
    {        
        $this->view->rows=$this->_model->default->getAll(array('id_zona = ?'=>$this->_idZona));
    }
    
    
    public function insertarAction()
    {
    	$this->_insertar();
    }

    public function editarAction()
    {
        $this->_editar();
    }
    
    public function borrarAction()
    {
        $this->_borrar();
    }


    protected function _prepareValuesToForm($row)
    {
        $row['f_alta'] = Sgit_Filter_DateDbToForm::filter($row['f_alta']);
        return $row;
    }

    protected function _prepareValuesToDb()
    {
        $row=$this->_form->getValues();
        $row['f_alta'] = Sgit_Filter_DateToDb::filter($row['f_alta']);
        $row['id_zona'] =$this->_idZona;
        return $row;
    }
    


}
